#win_import{"data-role"=>"window",
-#"data-place"=>"center",
"data-top"=>"20",
"data-left"=>"calc( 50% - 375px)",
"data-draggable"=>"false",
"data-btn-min"=>"false",
"data-btn-max"=>"false",
"data-resizable"=>"false",
"data-title"=>"#{t('project_import')}",
"data-close-action"=>"Metro.actions.HIDE",
"data-cls-caption"=>"kcoin-win-title",
"data-cls-master"=>"px-3",
"data-cls-window"=>"kcoin-win",
"data-on-caption-dbl-click"=>"",
"data-on-close-click"=>"closeWin"}
  #kcoin_stepper{"data-role"=>"stepper",
  "data-steps"=>"3",
  "data-cls-step"=>"kcoin-step",
  "data-cls-stepper"=>"kcoin-stepper",
  "data-cls-complete"=>"kcoin-stepper-complete",
  "data-cls-current"=>"kcoin-stepper-complete",
  "data-view"=>"cycle"}
  %form.kcoin-win-panel#import_form{:onsubmit=>"return false;",:enctype=>"multipart/form-data"}
    #kcoin_master{"data-role"=>"master",
                  "data-effect"=>"fade",
                  "data-cls-controls"=>"d-none",
                  "data-cls-pages"=>"border-none overflow-unset",
                  "data-cls-control-title"=>"d-none"}
      .page
        .row.mx-0
          .cell-12.form-group.px-0
            .px-5
              %input#search_input{type: "text",
                placeholder: "#{t('project_quick_import')}"}
            .kcoin-win-panel#projectList{"data-role"=>"panel",
            "data-width"=>"100%",
            "data-height"=>"100%",
            "data-cls-content"=>"px-5",
            "data-cls-panel"=>"border-none"}
            %template#projectListTemplate
              <% for(let item of data.values()){ %>
              %p.my-5
                %img.kcoin-img-org{src: "<%item[0].owner.avatar_url%>"}
                %label <%item[0].owner.login%>
                %label.fg-gray（<%item.length%> 个项目）
              %ul.mx-0.my-0
                <% for(var i = 0; i < item.length; i++) { %>
                %li.kcoin-li.d-flex.flex-align-center{name: "github_project_id",
                onclick: "showNextPage(<%list[i].id%>)",
                :value=>"<%list[i].id%>"} <%list[i].name%>
                <% } %>
              <% } %>
      .page
        .cell-12.form-group.px-0
          .import_title
            %img.pos-absolute.pos-left-center.ml-5{:src=>""}
            %span#project_title.pos-absolute.pos-left-center.ml-15
        .row.mx-0{"style"=>"overflow:auto;"}
          .cell-12.form-group.px-5
            %label
              = '1. ' + t('project_detail_name')
            %input.project_name{:type=>"text",
            :name=>"custom_name",
            maxlength: 120,
            "data-validate" => "required"}
            %span.invalid_feedback
              =t('project_detail_name_validate')
            %input#github_project_id{:type=>"hidden",:name=>"github_project_id"}
            %input.project_name{:type=>"hidden",:name=>"name"}
          .cell-12.form-group.px-5
            %label
              = '2. '+ t('project_decision')
            .user-kcoin-detail-link.d-inline-block
              %a{:href=>"/project/history?uId="}
              = t('see_more_result') + ' >'
            %select#decision_method{"data-role"=>"select",
            :name=>"discuss_method",
            "data-cls-select"=>"input",
            "data-filter"=>"false"}
              %option{:name=>"decision_method",:value=>"0"}
                独裁制
              %option{:name=>"decision_method",:value=>"1"}
                委员会单票制
              %option{:name=>"decision_method",:value=>"2"}
                委员会占比制
              %option{:name=>"decision_method",:value=>"3"}
                全体单票制
              %option{:name=>"decision_method",:value=>"4"}
                全体占比制
          .cell-12.form-group.px-5
            %label
              = '3. ' + t('project_token_name')
            .row.mx-0
              .cell-6.px-0
                %input#token_name{:type=>"text",
                :name=>"token_name",
                maxlength: 120,
                :placeholder => "#{t('project_token_name_placeholder')}",
                "data-validate" => "required"}
                %span.invalid_feedback
                  = t('project_token_name_validate')
              .cell-6.pl-2.pr-0
                %input#init_supply{:type=>"text",
                :name=>"init_supply",
                maxlength: 120,
                :placeholder => "#{t('project_token_supply')}",
                "data-validate" => "required pattern=^(?:[1-9]\\d*|0)?(?:\\.\\d+)?$"}
                %span.invalid_feedback
                  = t('project_token_supply_validate')
          .cell-12.form-group.px-5
            %label
              = '4. ' + t('project_import_img')
            %input#img{:type=>"file",
            "data-role"=>"file",
            :name=>"images",
            "data-button-title"=>"#{t('chose_files')}",
            "dir"=>"rtl",
            "data-validate"=>"custom=validateFileSize"}
        .row.mx-0.pt-5
          .cell-12.text-center.px-0.pos-bottom-center.mb-5
            %button.btn_prev.button.info.outline.mr-0-fs.mr-5-md.kcoin-button-normal
              = t('project_prev_btn')
            %button.btn_next.button.info.ml-0-fs.ml-5-md.kcoin-button-normal
              = t('project_next_btn')
      .page{:style=>"height:calc( 100% - 20px )"}
        .cell-12.form-group.px-0
          %div.ml-5
            %span
              = t('project_assign_token_title')
            %span.tokenName
            %span
              = t('project_assign_token_title2')
            %span#tokenNum
            %span.tokenName
        .row.mx-0{"style"=>"overflow:auto;height:calc( 100% - 62px )"}
          .kcoin-win-member-panel{"data-role"=>"panel",
          "data-width"=>"100%",
          "data-height"=>"100%",
          "data-cls-content"=>"px-5",
          "data-cls-panel"=>"border-none"}
            .row#memberList
            %template#memberListTemplate
              <% for(let item of data.values()){ %>
              %li.py-5.cell-6.px-0
                .row.mx-5{:style=>"height: 100%;"}
                  .member-img.stub.px-0{:style=>"width:81px"}
                    %img{:src=>"<%item.avatar_url%>"}
                  .member-msg.cell.px-0
                    .cell-12
                      %span
                        <%item.login%>
                    .cell-12
                      %input{:type=>"text",
                      :name=>"member_token",
                      maxlength: 120,
                      "data-member-id"=>"<%item.id%>",
                      :placeholder => "#{t('project_member_token_supply')}"}
                      %span.invalid_feedback
                        = t('project_token_validate')
              <% } %>
        .row.mx-0.pt-5
          .cell-12.text-center.px-0.pos-bottom-center.mb-5
            %button.btn_prev.button.info.outline.mr-0-fs.mr-5-md.kcoin-button-normal
              = t('project_prev_btn')
            %button#btn_submit.button.info.ml-0-fs.ml-5-md.kcoin-button-normal
              = t('project_import_btn')

= include_javascript 'project_list_none'
